package com.panshi.api;

import com.panshi.vo.ResponseVO;
import com.panshi.vo.UserVO;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import org.springframework.cloud.openfeign.FeignClient;

import javax.servlet.http.HttpServletRequest;

@Component
@FeignClient("HASBEI-USER-PROVIDER")
public interface UserGetApi {

    /**
     * 登录验证
     * @param userName
     * @param pwd
     * @return
     */
    @RequestMapping(value = "/loginVali", method = RequestMethod.POST)
    public ResponseVO loginValidate(@RequestParam String userName,@RequestParam String pwd);

    /**
     * 发送验证码
     * @param userName
     * @param type
     * @return
     */
    @RequestMapping(value = "/sendcode", method = RequestMethod.POST)
    public ResponseVO sendEmail(@RequestParam String userName,@RequestParam String type);

    /**
     * 注册新增
     * @param userName
     * @param pwd
     * @param code
     * @return
     */
    @RequestMapping(value = "/zhuceadd", method = RequestMethod.POST)
    public ResponseVO addUser(@RequestParam String userName,@RequestParam String pwd,@RequestParam String code);

    /**
     * 根据用户id查询用户信息
     * @param uid
     * @return
     */
    @RequestMapping(value = "/user/findUserByUid", method = RequestMethod.POST)
    public UserVO findUserByUid(@RequestParam String uid);

    /**
     * 根据邮箱查询用户信息
     * @param userName
     * @return
     */
    @RequestMapping(value = "/user/findUserByEmail", method = RequestMethod.POST)
    public UserVO findUserByEmail(@RequestParam String userName);

    /**
     * 修改用户基本信息 个签 昵称等
     * @param uid
     * @param nick
     * @param userDesc
     * @param logo
     * @return
     */
    @RequestMapping(value = "/user/updateUserInfo")
    public UserVO updateUserInfo(@RequestParam String uid,@RequestParam String nick,@RequestParam String userDesc,@RequestParam String logo);

    /**
     * 修改用户密码
     * @param uid
     * @param pwd
     * @return
     */
    @RequestMapping("/user_page/update/updatePwd")
    public ResponseVO updateUserPwd(@RequestParam String uid,@RequestParam String pwd);

    /**
     * 修改用户邮箱
     * @param uid
     * @param newMail
     * @return
     */
    @RequestMapping("/user_page/update/updateEmail")
    public ResponseVO updateUserEmail(@RequestParam String uid,@RequestParam String newMail);

}
